﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ModeloMagiPack.Entidades;
using Microsoft.Reporting.WinForms;
using BLLMagiPack.Managers;
using MaGiPack.ModeloPresentacion;

namespace MaGiPack
{
    public partial class FrmReporteVistaPrevia : Form
    {
        public FrmReporteVistaPrevia(OrdenReporte reporteData)
        {
            InitializeComponent();
            ConfigurarReporte(reporteData);
        }

        private void ConfigurarReporte(OrdenReporte reporteData)
        {
            if (reporteData.ArchivoFoto != null)
                rvOrden.LocalReport.ReportPath = AppDomain.CurrentDomain.BaseDirectory + @"\reportes\OrdenDeFabricacionConFoto.rdlc";
            
            OrdenReporteBindingSource.DataSource = reporteData;
        }

        private void FrmReporteVistaPrevia_Load(object sender, EventArgs e)
        {
            this.rvOrden.RefreshReport();
        }
    }
}
